package base.factory.television;

import base.factory.framework.Factory;
import base.factory.framework.Product;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

/**
 * @program: DesignPatterns
 * @description: 创建televi
 * @author: Mr.Dai
 * @create: 2018-05-07 16:45
 **/
public class TelevisionFactory  extends Factory {

    private TreeMap<Integer,String> teleS=new TreeMap<>();
    private int i=0;
    @Override
    protected Product createProduct(String name) {
        return new Televison(name);
    }

    @Override
    protected void registerProduct(Product product) {
        teleS.put(++i,((Televison)product).getName());
    }
    public TreeMap getTeles(){
        return  teleS;
    }
}
